<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport"
			content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />


		<title>XXX平台商家端</title>
		<script src="/Public/static/jquery-2.0.3.min.js"></script>

		<!--内容样式-->
		<link rel="stylesheet" href="__PUBLIC__/Home/supplier/css/style.css" />

		<style type="text/css">
			.ctx_box_upload{
				width: 450px;
				height: 450px;
				float: left;
				margin-left: 200px; 
				display: -webkit-flex;
				display: flex;
				flex-direction: column;
				align-items: center;
				position: relative;

			}
			.ctx_box_upload .ctxb-l{
				line-height: 25px;
				height: 25px;
			}
			.ctx_box_upload .ctxb-r{
				width: 100%
			}
			.ctx_box_upload .ctxbr-img{
				width: 450px;
				height: 285px;
				overflow: hidden;
			}
			.ctx_box_upload .ctxbr-img img{
				width: 100%;
				height: 100%;
			}

			.ctx_box_upload  .ctxbr-sc{
				width: 40px;
				height: 40px;
				position: absolute;
				right: 0;
				top:25px;
			}
		</style>>



	</head>

	<body>


		<div class="main">


			<include file="head" />


			<!--  左侧导航  -->
			<div class="nav">
				<div class="na-title">
					<img src="__PUBLIC__/Home/supplier/images/icon_ml.png" />
					<div class="nat-mc">目录</div>
					<div class="divclear"></div>
				</div>
				<div class="na-box">

				<a href="{:U('supplier_index')}" <if condition="$cur eq '供应商管理'">class="nab-btn cur"<else/>class="nab-btn"</if>>帐号设置</a>
				<a href="{:U('account_setup')}" <if condition="$cur eq '账户设置'">class="nab-btn cur"<else/>class="nab-btn"</if>>账户设置</a>

				</div>
			</div>


			<!--  右侧内容  -->
			<div class="content">

				<div class="ct-title">
					<div class="ctt-bt">绑定银行卡账户</div>
				</div>
				<form action="" method="POST">
					<div class="ct-box">
						<div class="item">
							<div class="title">姓名</div>
							<input type="text" placeholder="" class="ctc-wb" name="name" value="{$info['name']}">
							<div class="divclear"></div>
						</div>
						<div class="item">
							<div class="title">银行卡号</div>
							<input type="text" placeholder="" class="ctc-wb" name="bank_num" value="{$info['bank_num']}">
							<div class="divclear"></div>
						</div>
						<div class="item">
							<div class="title">银行卡开户地</div>
							<input type="text" placeholder="" class="ctc-wb" name="attribution" value="{$info['attribution']}">
							<div class="divclear"></div>
						</div>
						<div class="item">
							<div class="title">身份证号</div>
							<input type="text" placeholder="" class="ctc-wb" name="IDcard" value="{$info['idcard']}">
							<div class="divclear"></div>
						</div>
						<if condition="$upload_status != 2">
						<div class="ctx-box item">
			                <div class="ctxb-l title" style="width: 10">联系手机：</div>
			                <div class="ctxb-r" style=" display:flex; flex-direction: row">
			                    <input type="text" placeholder="请输入负责人联系方式" class="ctxbr-wb mobile" name="mobile" value="{$info.mobile}" style="width:450px">
			                        <div class="ctxb-r getCode" style="border: 1px solid #e5e5e5; border-left: 0; text-align: center; width: 150px ; font-size: 14px; height: 48px; line-height: 48px; cursor: pointer" onclick="getCode()">获取验证码</div>
			                </div>
			            
			                <input type="hidden" class="sms_id" name="sms_id">
			                <script>
			                    function getCode() {
			                        var val = $('.getCode').html();
			                        if (val == '获取验证码') {
			                            var time = 60;
			                            var timer = setInterval(function () {
			                                --time;
			                                if (time > 0) {
			                                    $('.getCode').html(time + 's');
			                                } else {
			                                    $('.getCode').html('获取验证码');
			                                    clearInterval(timer);
			                                }
			                            }, 1000)

			                            var url = "{:U('sendSms')}";
			                            var mobile = $('.mobile').val();

			                            $.post(url, {
			                                mobile: mobile
			                            }, function (res) {
			                                if (res.result == 1) {
			                                    $('.sms_id').val(res.data);
			                                } else {
			                                    layer.msg(res.msg);
			                                }
			                            }, 'json')
			                        }
			                    }
			                </script>
			                <div class="divclear"></div>
			            </div>
						<div class="item">
							<div class="title">验证码</div>
							<input type="text" placeholder="" class="ctc-wb" name="code" >
							<div class="divclear"></div>
						</div>
						<else />
							<div class="item">
								<div class="title">联系手机：</div>
								<input type="text" placeholder="" class="ctc-wb" name="mobile" value="{$info['mobile']}">
								<div class="divclear"></div>
							</div>
						</if>
						<div class="item">
							<div class="title">开户行</div>
							<select style="height: 50px; border:1px #ddd solid" name="bank_id">
								<option>请选择开户行</option>
								<volist name="bank_list" id="vo">
			                        <option value="{$vo.bank_id}"
			                        <if condition="$vo['bank_id'] == $info['bank_id']">selected</if>
			                        >{$vo.name}</option>
			                    </volist>
							</select>
							<div class="divclear"></div>
						</div>
						
				        <div class="ctx_box_upload">
				            <div class="ctxb-l">身份证正面：</div>
				            <input type="file" id="card_front_file" style="display: none">
				            <input type="hidden" name="card_front" id="card_front" value="{$info.card_front}"/>
				            <div class="ctxb-r" style="padding: 0;border: 1px dashed #ccc;">
				                <div class="ctxbr-img">
				                    <if condition="$info['card_front'] == ''">
				                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="card_front_Img"/>
				                        <else/>
				                        <img src="{$info['card_front_path']}" id="card_front_Img"/>
				                    </if>
				                </div>
				                <div class="ctxbr-sc">
				                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delCardFrontImg"/>
				                </div>
				            </div>
				            <script type="text/javascript">
				                $("#card_front_Img").click(function () {
				                    $("#card_front_file").trigger("click");
				                })
				                $('#card_front_file').change(function () {
				                    var pic = $(this)[0].files[0];
				                    var formData = new FormData();
				                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
				                    formData.append('download', pic);
				                    $.ajax({
				                        url: url,
				                        type: "post",
				                        data: formData,
				                        cache: false,
				                        contentType: false,
				                        processData: false,
				                        success: function (data) {
				                            //console.log(data);
				                            if (data.status == 1) {
				                                //上传成功
				                                var id = data.id;
				                                var path = data.path;

				                                $('#card_front').val(id);
				                                $('#card_front_Img').attr('src', path);
				                            } else {
				                                layer.msg(data.info);
				                            }
				                        }
				                    });
				                });

				                //删除图片
				                $("#delCardFrontImg").click(function () {
				                    $('#card_front').val("");
				                    $('#card_front_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
				                })
				            </script>
				            <div class="divclear"></div>
				            <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
				                上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：450px * 285px
				            </div>
				        </div>
				        <div class="ctx_box_upload">
				            <div class="ctxb-l">身份证反面：</div>
				            <input type="file" id="card_behind_file" style="display: none">
				            <input type="hidden" name="card_behind" id="card_behind" value="{$info.card_behind}"/>
				            <div class="ctxb-r" style="padding: 0;border: 1px dashed #ccc;">
				                <div class="ctxbr-img">
				                    <if condition="$info['card_front'] == ''">
				                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="card_behind_Img"/>
				                        <else/>
				                        <img src="{$info['card_behind_path']}" id="card_behind_Img"/>
				                    </if>
				                </div>
				                <div class="ctxbr-sc">
				                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delCardBehindImg"/>
				                </div>
				            </div>
				            <script type="text/javascript">
				                $("#card_behind_Img").click(function () {
				                    $("#card_behind_file").trigger("click");
				                })
				                $('#card_behind_file').change(function () {
				                    var pic = $(this)[0].files[0];
				                    var formData = new FormData();
				                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
				                    formData.append('download', pic);
				                    $.ajax({
				                        url: url,
				                        type: "post",
				                        data: formData,
				                        cache: false,
				                        contentType: false,
				                        processData: false,
				                        success: function (data) {
				                            //console.log(data);
				                            if (data.status == 1) {
				                                //上传成功
				                                var id = data.id;
				                                var path = data.path;

				                                $('#card_behind').val(id);
				                                $('#card_behind_Img').attr('src', path);
				                            } else {
				                                layer.msg(data.info);
				                            }
				                        }
				                    });
				                });

				                //删除图片
				                $("#delCardBehindImg").click(function () {
				                    $('#card_behind').val("");
				                    $('#card_behind_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
				                })
				            </script>
				            <div class="divclear"></div>
				            <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
				                上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：450px * 285px
				            </div>
				        </div><div class="divclear"></div>

				        <div class="ctx_box_upload ">
				            <div class="ctxb-l">手持身份证：</div>
				            <input type="file" id="hold_card_file" style="display: none">
				            <input type="hidden" name="hold_card" id="hold_card" value="{$info.hold_card}"/>
				            <div class="ctxb-r" style="padding: 0;border: 1px dashed #ccc;">
				                <div class="ctxbr-img">
				                    <if condition="$info['hold_card_path'] == ''">
				                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="hold_card_img"/>
				                        <else/>
				                        <img src="{$info['hold_card_path']}" id="hold_card_img"/>
				                    </if>
				                </div>
				                <div class="ctxbr-sc">
				                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBusinessLicenseImg"/>
				                </div>
				            </div>
				            <div class="divclear"></div>
				            <script type="text/javascript">
				                $("#hold_card_img").click(function () {
				                    $("#hold_card_file").trigger("click");
				                })
				                $('#hold_card_file').change(function () {
				                    var pic = $(this)[0].files[0];
				                    var formData = new FormData();
				                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id(), 'max_kb' => 200))}";
				                    formData.append('download', pic);
				                    $.ajax({
				                        url: url,
				                        type: "post",
				                        data: formData,
				                        cache: false,
				                        contentType: false,
				                        processData: false,
				                        success: function (data) {
				                            //console.log(data);
				                            if (data.status == 1) {
				                                //上传成功
				                                var id = data.id;
				                                var path = data.path;

				                                $('#hold_card').val(id);
				                                $('#hold_card_img').attr('src', path);
				                            } else {
				                                layer.msg(data.info);
				                            }
				                        }
				                    });
				                });

				                //删除图片
				                $("#delBusinessLicenseImg").click(function () {
				                    $('#hold_card').val("");
				                    $('#hold_card_img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
				                })
				            </script>
				            <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
				                上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：450px * 285px
				            </div>

				        </div>

				        <div class="divclear"></div>
				        	<div class="item">
					        <if condition="$upload_status != 2">
								<button class="ctc-btn1" type="submit">确定绑定</button>
							</if>
						</div>			            
				        </div><div class="divclear"></div>

						
					</div>
				</form>





			</div>


		</div>


	</body>
</html>
